package cn.chencaiju.day11;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import org.junit.Test;

public class CharTest {
	@Test public void testChar() {
		char a='中';
		System.out.println(a);
		System.out.println("中".getBytes().length);
	}
	@Test public void testWrite() throws FileNotFoundException {
		
		try(
			FileOutputStream fo=new FileOutputStream("test.txt")
			)
		{
			fo.write('中');
			fo.write("中国".getBytes());
		} catch (IOException e) {
			e.printStackTrace();
		}	
	}
}
